'use strict'
class login {
    constructor() {

    }
    async post(c) {
        const body = JSON.parse(c.body);
        let logname = body.username;
        let logcode = body.code;
        let flag = 'false';
        let usersCode = await c.service.pqorm.model('user').where({ username: `${logname}` }).select('code');
        console.log(usersCode)
        if (logcode == usersCode[0].code) {
            flag = 'true';
        }
        c.send(flag);
    }
}

module.exports = login